//
//  DsCellView.m
//  Tour
//
//  Created by 张张烨 on 16/3/10.
//  Copyright © 2016年 张中烨. All rights reserved.
//

#import "DsCellView.h"

@implementation DsCellView


-(instancetype)initWithFrame:(CGRect)frame touxiang:(NSString *)touxiang kaishitian:(NSString *)kaishi jieshutian:(NSString *)jieshu mingzi:(NSString *)mingzi beijing:(NSString *)beijing
{
    self = [super initWithFrame:frame];
    if (self) {
        
        UIImageView *img = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, WIDTH, 250 * GAO)];
        [img sd_setImageWithURL:[NSURL URLWithString:beijing]];
        [self addSubview:img];
        
        UILabel *lable =[[UILabel alloc]initWithFrame:CGRectMake(80 * KUAN, 200 * GAO, 300 * KUAN, 30 * GAO)];
        lable.font = [UIFont systemFontOfSize:14];
        lable.textColor = [UIColor whiteColor];
        lable.text = [NSString stringWithFormat:@"%@ ~ %@",kaishi,jieshu];
        [self addSubview:lable];
        
        UILabel *mingzi1  = [[UILabel alloc]initWithFrame:CGRectMake(30  * KUAN, 65 * GAO, 300 * KUAN, 60 * GAO)];
        mingzi1.textColor = [UIColor whiteColor];
        mingzi1.numberOfLines = 0;
        mingzi1.text = [NSString stringWithFormat:@"         %@",mingzi];;
        [self addSubview:mingzi1];
        
        UIImageView *img1 = [[UIImageView alloc]initWithFrame:CGRectMake(10 * KUAN, 200  *GAO, 40 * KUAN, 40 * KUAN)];
        img1.layer.borderColor = [[UIColor whiteColor] CGColor];
        img1.layer.borderWidth = 3.0f;
        
        img1.userInteractionEnabled = YES;
        [img1 sd_setImageWithURL:[NSURL URLWithString:touxiang]];
        [self addSubview:img1];
        
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap)];
        [img1 addGestureRecognizer:tap];
 
    }
    return self;
}

-(void)tap
{
    [self.delegate passTag];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
